﻿/*
 * Returns a new date using a specified datetime.
 */
create function [Date].[FromDateTime] ( @p_DateTime datetime )
returns date as
begin

  return DateAdd( Day, 0, DateDiff( Day, 0, @p_DateTime ) );

end